DiscreteIndicator
DiscreteIndicator[x,x1,{u1,u2,…}] yields the discrete indicator function, equal to 1 if x=x1 and, otherwise, to 0 if x=ui for some i.
Please visit the official Wolfram Language Reference for more details and examples on core symbols.